#!/bin/bash

current_dir="/usr1/code/EulerOS_V200R008C00_FossID_Part1/code/current"
cur_dir=`pwd`

function deleteCode()
{
    cd $current_dir
    cat ${cur_dir}/delete_list | while read line
    do
        if [ -d ./open_source/${line} ];then
            rm -rf ./open_source/${line}
        fi
    done
    for dir in `find . -name .repo -type d`
    do
        if [ -d $dir ];then
            rm -rf $dir
        fi
    done
    for dir in `find . -name .git -type d`
    do
        if [ -d $dir ];then
            rm -rf $dir
        fi
    done
    if [ -d flag ];then
        rm -rf flag
    fi
    if [ -d release ];then
        rm -rf release
    fi
    if [ -f scmInfo.properties ];then
        rm -f scmInfo.properties
    fi
    if [ -f scmInfo.xml ];then
        rm -f scmInfo.xml
    fi
    cd $cur_dir
}

deleteCode
